package com.itheima.servlets.service.impl;

import com.itheima.servlets.dao.UserDao;
import com.itheima.servlets.dao.impl.UserDaoImpl;
import com.itheima.servlets.domain.Student;
import com.itheima.servlets.domain.User;
import com.itheima.servlets.service.UserService;

import java.io.IOException;
import java.util.ArrayList;

public class UserServiceImpl implements UserService {
    @Override
    public User login(String username, String pwd) throws Exception {
        UserDao userDao = new UserDaoImpl();
        return userDao.login(username,pwd);
    }

    @Override
    public void addStudent(Student stu) throws IOException {
        UserDao userDao = new UserDaoImpl();
        userDao.addStudent(stu);
    }

    @Override
    public void findStudent(ArrayList<Student> list) throws IOException {
        UserDao userDao = new UserDaoImpl();
        userDao.findStudent(list);
    }
}
